(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/boxDetail/index" ], {
    "141a": function(t, n, e) {
        "use strict";
        e.r(n);
        var i = e("8c36"), o = e.n(i);
        for (var u in i) [ "default" ].indexOf(u) < 0 && function(t) {
            e.d(n, t, function() {
                return i[t];
            });
        }(u);
        n.default = o.a;
    },
    "1c44": function(t, n, e) {
        "use strict";
        var i = e("662f");
        e.n(i).a;
    },
    "23f0": function(t, n, e) {
        "use strict";
        e.d(n, "b", function() {
            return o;
        }), e.d(n, "c", function() {
            return u;
        }), e.d(n, "a", function() {
            return i;
        });
        var i = {
            TextNavBar: function() {
                return e.e("components/TextNavBar/TextNavBar").then(e.bind(null, "9141"));
            },
            CountDown: function() {
                return e.e("components/CountDown/CountDown").then(e.bind(null, "2fed"));
            },
            uniPopup: function() {
                return e.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(e.bind(null, "0fa2"));
            },
            BoxSkuPopup: function() {
                return e.e("components/BoxSkuPopup/BoxSkuPopup").then(e.bind(null, "f1cb"));
            },
            SharePopup: function() {
                return Promise.all([ e.e("common/vendor"), e.e("components/SharePopup/SharePopup") ]).then(e.bind(null, "b677"));
            },
            HiddenSkuRank: function() {
                return e.e("components/HiddenSkuRank/HiddenSkuRank").then(e.bind(null, "0818"));
            },
            Danmus: function() {
                return e.e("components/Danmus/Danmus").then(e.bind(null, "4bc1"));
            }
        }, o = function() {
            var t = this, n = (t.$createElement, t._self._c, t.isInit && t.info.is_presell && 0 !== t.info.presell_mode && 1 === t.info.presell_mode ? t.$tool.formatDate(t.info.presell_date, "yyyy-MM-dd") : null);
            t._isMounted || (t.e0 = function(n) {
                t.isSharePopup = !0;
            }, t.e1 = function(n) {
                t.isShowHiddenSkuRank = !0;
            }, t.e2 = function(n) {
                return t.$refs.detailPopup.close();
            }, t.e3 = function(n) {
                t.isSharePopup = !1;
            }, t.e4 = function(n) {
                t.isShowHiddenSkuRank = !1;
            }), t.$mp.data = Object.assign({}, {
                $root: {
                    g0: n
                }
            });
        }, u = [];
    },
    "25ed": function(t, n, e) {
        "use strict";
        e.r(n);
        var i = e("23f0"), o = e("141a");
        for (var u in o) [ "default" ].indexOf(u) < 0 && function(t) {
            e.d(n, t, function() {
                return o[t];
            });
        }(u);
        e("1c44");
        var r = e("f0c5"), a = Object(r.a)(o.default, i.b, i.c, !1, null, "74224a21", null, !1, i.a, void 0);
        n.default = a.exports;
    },
    "662f": function(t, n, e) {},
    "7f10": function(t, n, e) {
        "use strict";
        (function(t, n) {
            var i = e("4ea4");
            e("18ba"), i(e("66fd"));
            var o = i(e("25ed"));
            t.__webpack_require_UNI_MP_PLUGIN__ = e, n(o.default);
        }).call(this, e("bc2e").default, e("543d").createPage);
    },
    "8c36": function(t, n, e) {
        "use strict";
        (function(t) {
            var i = e("4ea4");
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var o = i(e("2eee")), u = i(e("c973")), r = i(e("9523"));
            function a(t, n) {
                var e = Object.keys(t);
                if (Object.getOwnPropertySymbols) {
                    var i = Object.getOwnPropertySymbols(t);
                    n && (i = i.filter(function(n) {
                        return Object.getOwnPropertyDescriptor(t, n).enumerable;
                    })), e.push.apply(e, i);
                }
                return e;
            }
            function s(t) {
                for (var n = 1; n < arguments.length; n++) {
                    var e = null != arguments[n] ? arguments[n] : {};
                    n % 2 ? a(Object(e), !0).forEach(function(n) {
                        (0, r.default)(t, n, e[n]);
                    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)) : a(Object(e)).forEach(function(n) {
                        Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(e, n));
                    });
                }
                return t;
            }
            var c = {
                components: {
                    BoxThmemDefault: function() {
                        e.e("pages/boxDetail/boxTheme/Default").then(function() {
                            return resolve(e("c265"));
                        }.bind(null, e)).catch(e.oe);
                    },
                    BoxTheme3D: function() {
                        e.e("pages/boxDetail/boxTheme/Box3D").then(function() {
                            return resolve(e("798f"));
                        }.bind(null, e)).catch(e.oe);
                    }
                },
                data: function() {
                    return {
                        loading: !0,
                        test: !1,
                        uuid: "",
                        info: {},
                        number: 12,
                        contentHeight: 4e3,
                        deepColor: !1,
                        startMoving: !1,
                        userlist: [],
                        deviceHeight: this.$device.screenHeight,
                        viewType: "3d",
                        isSharePopup: !1,
                        isShowHiddenSkuRank: !1,
                        isShowDetail: !1,
                        isInit: !1,
                        danmuList: [],
                        danmuSetting: {},
                        skuList: [],
                        skuListSetting: {}
                    };
                },
                computed: s(s({}, (0, e("26cb").mapGetters)([ "userInfo", "token" ])), {}, {
                    config: function() {
                        return this.$store.getters.setting.box_room || {};
                    },
                    contentStyle: function() {
                        return "min-height:".concat(this.contentHeight, "px;background-color: ").concat(this.info.bg_color, ";");
                    },
                    room: function() {
                        return this.info.room || {};
                    },
                    avatar: function() {
                        return this.token ? this.userInfo.headimg : "/static/toux.png";
                    },
                    share: function() {
                        return {
                            title: this.info.title,
                            thumb: this.info.thumb,
                            desc: "",
                            path: "/pages/boxDetail/index?uuid=" + this.info.uuid + "&invite_node=box-" + this.info.uuid
                        };
                    },
                    posterInfo: function() {
                        var t = this.getShareConfig(!1);
                        return {
                            money_price: this.info.money_price,
                            score_price: this.info.score_price,
                            title: this.info.title,
                            path: t.path,
                            app_url: t.app_url,
                            thumb: this.info.thumb
                        };
                    },
                    bgImage: function() {
                        return this.isInit ? this.info.room_bg_image || this.config.bg_image || "https://cdn2.hquesoft.com/box/bg.png" : "";
                    },
                    isDarkMode: function() {
                        return 2 === this.info.bg_color_mode;
                    },
                    tips: function() {
                        return this.info.tips || "官方正品，非质量问题不支持退换";
                    },
                    isThemeChangeable: function() {
                        return 1 === this.info.theme_mode || 2 === this.info.theme_mode;
                    }
                }),
                onLoad: function(n) {
                    var e = this;
                    this.test = !!n.test, this.uuid = n.uuid, t.getSystemInfo({
                        success: function(t) {
                            e.contentHeight = t.windowHeight;
                        }
                    }), t.showLoading({
                        title: "加载中",
                        mask: !0
                    }), this.$http("/boxes/" + n.uuid).then(function(n) {
                        e.isInit = !0, e.loading = !1, t.hideLoading();
                        var i = n.data.info;
                        e.info = i, t.setNavigationBarTitle({
                            title: e.info.title
                        }), 2 !== e.info.theme_mode && 4 !== e.info.theme_mode || (e.viewType = "default"), 
                        e.$visitor.record({
                            type: "box_detail",
                            title: e.info.title
                        }), e.$http("/boxes/".concat(e.uuid, "/skus")).then(function(t) {
                            e.skuList = t.data.list;
                        }), e.getDanmu();
                    }).catch(function(n) {
                        t.hideLoading();
                    }), this.config.bgm && this.$playBgm(this.config.bgm);
                },
                watch: {
                    config: function() {
                        this.config.bgm && this.$playBgm(this.config.bgm);
                    }
                },
                onUnload: function() {
                    this.$stopBgm();
                },
                onShow: function() {
                    var t = this;
                    this.info.uuid && this.$http("/boxes/" + this.info.uuid, "GET", {
                        room_id: this.room.id
                    }).then(function(n) {
                        var e = n.data.info;
                        t.info = e;
                    }), this.$http("/setting/box").then(function(n) {
                        t.skuListSetting = n.data.setting;
                    });
                },
                methods: {
                    goLotteryDetail: function() {
                        t.navigateTo({
                            url: "/pages/lottery/detail?uuid=" + this.info.lottery.uuid
                        });
                    },
                    goJikaDetail: function() {
                        t.navigateTo({
                            url: "/pages/jika/detail?uuid=" + this.info.jika.uuid
                        });
                    },
                    buyMany: function(n) {
                        if (this.info.is_presell && 0 === this.info.presell_mode) return t.showToast({
                            title: "此款正在预售中，暂不可购买哦~",
                            icon: "none"
                        }), !1;
                        var e = this.room.sku_status.findIndex(function(t) {
                            return 0 === t;
                        });
                        if (-1 == e) return t.showToast({
                            title: "此盒已售完，换一盒吧~",
                            icon: "none"
                        }), !1;
                        t.navigateTo({
                            url: "/pages/openBox/index?index=".concat(e + 1, "&roomUuid=").concat(this.room.uuid, "&uuid=").concat(this.info.uuid, "&buyMode=").concat(n)
                        });
                    },
                    buyWholeRoom: function() {
                        var n = this;
                        if (this.info.is_presell && 0 === this.info.presell_mode) return t.showToast({
                            title: "此款正在预售中，暂不可购买哦~",
                            icon: "none"
                        }), !1;
                        this.$http("/user").then(function(e) {
                            t.navigateTo({
                                url: "/pages/openBox/index?index=".concat(2, "&roomUuid=").concat(n.room.uuid, "&uuid=").concat(n.info.uuid, "&buyMode=wholeRoom")
                            });
                        });
                    },
                    getDanmu: function() {
                        var t = this;
                        this.$http("/danmus/box_detail?node_id=".concat(this.info.id)).then(function(n) {
                            t.danmuSetting = n.data.setting, t.danmuList = n.data.list;
                        });
                    },
                    changeView: function() {
                        "default" == this.viewType ? this.viewType = "3d" : "3d" == this.viewType && (this.viewType = "default");
                    },
                    refresh: function(n) {
                        var e = this;
                        return (0, u.default)(o.default.mark(function n() {
                            var i;
                            return o.default.wrap(function(n) {
                                for (;;) switch (n.prev = n.next) {
                                  case 0:
                                    return t.showLoading({}), n.next = 3, getBoxInfo(e.info.uuid);

                                  case 3:
                                    i = n.sent, e.info = i.data.info, t.hideLoading();

                                  case 6:
                                  case "end":
                                    return n.stop();
                                }
                            }, n);
                        }))();
                    },
                    handleSelect: function(n) {
                        this.test ? t.navigateTo({
                            url: "/pages/testOpenBox/index?index=".concat(n + 1, "&roomUuid=").concat(this.room.uuid, "&uuid=").concat(this.info.uuid)
                        }) : t.navigateTo({
                            url: "/pages/openBox/index?index=".concat(n + 1, "&roomUuid=").concat(this.room.uuid, "&uuid=").concat(this.info.uuid)
                        });
                    },
                    hideImages: function() {
                        this.visible = !1;
                    },
                    showImages: function() {
                        this.$refs.detailPopup.open("bottom");
                    },
                    exchangeNumber: function() {
                        var n = this;
                        t.showLoading({
                            title: "加载中",
                            mask: !0
                        }), this.startMoving = !0, setTimeout(function() {
                            n.startMoving = !1;
                        }, 400), setTimeout(function() {
                            n.$http("/boxes/".concat(n.info.uuid, "/next-room"), "GET", {
                                uuid: n.info.uuid,
                                current_room_id: n.room.id
                            }).then(function(e) {
                                t.hideLoading(), n.info.room = e.data.room;
                            }).catch(function(n) {
                                console.log(n), t.hideLoading();
                            });
                        }, 200);
                    },
                    colorRgb: function(t) {
                        var n = t.toLowerCase();
                        if (4 === n.length) {
                            for (var e = "#", i = 1; i < 4; i += 1) e += n.slice(i, i + 1).concat(n.slice(i, i + 1));
                            n = e;
                        }
                        var o = [];
                        for (i = 1; i < 7; i += 2) o.push(parseInt("0x" + n.slice(i, i + 2)));
                        return this.sumArr(o);
                    },
                    sumArr: function(t) {
                        return t.reduce(function(t, n) {
                            return t + n;
                        }, 0);
                    }
                }
            };
            n.default = c;
        }).call(this, e("543d").default);
    }
}, [ [ "7f10", "common/runtime", "common/vendor" ] ] ]);